package com.sjh.test.java8.time;

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeFormatterTest1 {

    public static void main(String args[]) {
        DateTimeFormatterTest1 tester = new DateTimeFormatterTest1();
        tester.run();
    }

    public void run() {

        ZonedDateTime now = ZonedDateTime.now();
        System.out.println("当前时间是: " + now);

        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd H:m:s");
        System.out.println("另一种表示形式:" + now.format(formatter));
    }
}
